<?php
class WebPageTypeModel extends Model {
	var $_table = 'web_page_type';
	var $page_type_id_nak;
	var $page_type_sr; // VARCHAR(16) NOT NULL COMMENT '页面类型',
	var $page_type_name_sr; // VARCHAR(32) NOT NULL COMMENT '类型名称',
	var $default_template_sr = ''; // VARCHAR(128) NULL COMMENT '默认模板',
	var $note_s = ''; // VARCHAR(256) NULL COMMENT '备注',
	

	public function deleteType($page_type) {
		$where = array ('page_type' => $page_type );
		$rst = $this->delete ( $where );
		$tplM = new WebTemplateModel ();
		//将模板页面删除
		$rst = $rst !== false ? $tplM->delete ( $where ) : false;
		return $rst !== false;
	}
	
	public function check_page_type($value, $data) {
		$where ['page_type'] = $value;
		if (! empty ( $data ['page_type_id'] )) {
			$where ['page_type_id !='] = $data ['page_type_id'];
		}
		return $this->exist ( $where ) ? "页面类型已经存在" : true;
	}
}